package com.newtouch.bxzs.account.service;

import com.nimbusds.jose.jwk.KeyUse;
import com.nimbusds.jose.jwk.RSAKey;
import com.nimbusds.jose.jwk.gen.RSAKeyGenerator;
import lombok.SneakyThrows;

/**
 * JWK接口
 *
 * <p>
 * <b>History:</b>
 * <table border="1">
 * <tr>
 * <th>Date</th>
 * <th>Operator</th>
 * <th>Memo</th>
 * </tr>
 * <tr>
 * <td>2021年3月4日</td>
 * <td>Amour</td>
 * <td>Create</td>
 * </tr>
 * </table>
 * 
 * @author Amour
 * 
 * @version 1.0.0
 * @since 1.0.0
 */
public interface JwkGenerator {

	/**
	 * JWK
	 * 
	 * @return
	 */
	@SneakyThrows
	static RSAKey generate() {
		return new RSAKeyGenerator(2048).keyUse(KeyUse.SIGNATURE).keyID("123").generate();
	}

}
